package com.gwt.client.mvp;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.gwt.client.ClientFactory;
import com.gwt.client.activity.SlideActivity;
import com.gwt.client.place.SlidePlace;

public class AppActivityMapper implements ActivityMapper {

	private ClientFactory clientFactory;

	public AppActivityMapper(ClientFactory clientFactory) {
		super();
		this.clientFactory = clientFactory;
	}

	@Override
	public Activity getActivity(Place place) {

		if (place instanceof SlidePlace) {
			return new SlideActivity((SlidePlace) place, clientFactory);
		}

		return null;
	}

}
